package cn.edu.scau.cmi.linyuetao.abstractFactory;
	
import java.io.IOException;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;


public class Main extends Application {
	private Stage primaryStage;
	
	@Override
	public void start(Stage primaryStage) {
		try {
			this.primaryStage = primaryStage;
			showIndex();
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	
	IndexController indexController;
	private void showIndex() throws IOException {
		// TODO Auto-generated method stub
		FXMLLoader loader = new FXMLLoader();
		loader.setLocation(Main.class.getResource("index.fxml"));
		AnchorPane index = (AnchorPane)loader.load();
		Scene scene = new Scene(index);
		primaryStage.setScene(scene);
		primaryStage.show();
		indexController = loader.getController();
		indexController.setMainApp(this,true);
		String URL = "resource/linyuetao.jpg";
		Image image = new Image("file:"+URL);
		indexController.getImageView().setImage(image);
	}

	public static void main(String[] args) {
		launch(args);
	}

	public IndexController getIndexController() {
		return indexController;
	}

	public void setIndexController(IndexController indexController) {
		this.indexController = indexController;
	}
	
	
}
